package com.study.mike.common;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.junit.jupiter.api.Test;
import org.junit.platform.commons.util.StringUtils;


/**
 * 验空测试
 *
 * @author KangHui
 * @Date 2022/9/9 10:38
 */
public class NullOrEmpty extends DemoApplicationTests {
    @Test
    void huToolStrUtilTest() {
        String str = "";
        String str1 = null;
        String str2 = " ";
        if (StrUtil.isNotBlank(str)) {
            System.out.println("isNotBlank-str");
        }
        if (StrUtil.isNotEmpty(str)) {
            System.out.println("isNotBlank-str");
        }
        if (StrUtil.isNotBlank(str1)) {
            System.out.println("isNotBlank-str1");
        }
        if (StrUtil.isNotEmpty(str1)) {
            System.out.println("isNotBlank-str1");
        }
        if (StrUtil.isNotBlank(str2)) {
            System.out.println("isNotBlank-str2");
        }
        if (StrUtil.isNotEmpty(str2)) {
            System.out.println("isNotBlank-str2");
        }
        if (ObjectUtil.isNotNull(str)) {
            System.out.println("isNotNull-str");
        }
        if (ObjectUtil.isNotNull(str1)) {
            System.out.println("isNotNull-str1");
        }
        if (ObjectUtil.isNotNull(str2)) {
            System.out.println("isNotNull-str2");
        }
    }
    @Test
    void StringUtilsTest() {
        String str = "isno";
        if (StringUtils.containsWhitespace(str)) {
            System.out.println("携带空格");
        }
      String status = "c";
        if ("c、b、d、o".contains(status)) {
            System.out.println(true);
        }
    }



}
